package com.clwl.supervise.superviseapp.mapper.supervise;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.clwl.supervise.superviseapp.entity.supervise.JgDailyStandard;
import com.clwl.supervise.superviseapp.entity.supervise.JgStandard;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface JgDailyStandardMapper extends BaseMapper<JgDailyStandard> {

    /**
     * 日常检查 双随机检查获取检查内容
     * @param supProcess
     * @param companyTypeId
     * @param dailyCheckId
     * @return
     */
    List<Map<String, Object>> selectStandardList(@Param("supProcess") String supProcess, @Param("companyTypeId") Long companyTypeId, @Param("dailyCheckId") Long dailyCheckId,String supCategory);

    /**
     * 社会评分检查内容
     * @param supProcess
     * @param companyTypeId
     * @param dailyCheckId
     * @param supCategory
     * @return
     */
    List<Map<String, Object>> selectLiabilityStandardList(@Param("supProcess") String supProcess, @Param("companyTypeId") Long companyTypeId, @Param("dailyCheckId") Long dailyCheckId,@Param("dynamicScoringId") Long dynamicScoringId, String supCategory);

    /**
     * 获取社会评分模版
     * @param supProcess
     * @param companyTypeId
     * @param dailyCheckId
     * @param supCategory
     * @return
     */
    List<Map<String, Object>> selectLiabilityList(@Param("supProcess") String supProcess, @Param("companyTypeId") Long companyTypeId, @Param("dailyCheckId") Long dailyCheckId,String supCategory);

    /**
     * 通过日检查的检查单子获取记录的日检查标准
     * @param standardId
     * @param dailyCheckId
     * @return
     */
    JgDailyStandard selectStandard(@Param("standardId") Long standardId, @Param("dailyCheckId") Long dailyCheckId);

    /**
     * 查询冗长检查关联的日常检查标准
     * @param checkId
     * @return
     */
    List<Map<String, Object>> selectDailyCheckId(@Param("checkId") Long checkId);

    /**
     * 动态风险评分获取检查内容
     * @param supProcess
     * @param companyTypeId
     * @param dynamicRiskId 动态风险单
     * @return
     */
    List<Map<String, Object>> selectDynamicStandardList(@Param("supProcess") String supProcess, @Param("companyTypeId") Long companyTypeId, @Param("dynamicRiskId") Long dynamicRiskId);

    /**
     * 动态风险评分获取检查内容
     * @param supProcess
     * @param companyTypeId
     * @param dynamicRiskId 动态风险单
     * @return
     */
    List<JgStandard> selectDynamicStandardEntityList(@Param("supProcess") String supProcess, @Param("companyTypeId") Long companyTypeId, @Param("dynamicRiskId") Long dynamicRiskId);


    List<JgDailyStandard> selectStandardByCheckId(@Param("checkId") Long checkId);

    int batchInsert(@Param("list") List<JgDailyStandard> newStandards);

    int batchUpdate(@Param("list") List<JgDailyStandard> updateDailyStandards);
}